package com.yz.design.strategyDesign;

import lombok.Getter;

/**
 * @author 广长
 * @version V1.0
 * @className PaymentIsInvoiceEnum
 * @description 发佣类型枚举
 * @date 2020/12/23
 **/
@Getter
public enum RequestTypeEnum {
    //发佣类型：1成交单，2用工
    DEAL_REQUEST("1", "成交发佣", "dealPaymentRequestServiceImpl"),
    JOB_REQUEST("2", "用工发佣", "jobPaymentRequestServiceImpl");


    private final String key;

    private final String desc;

    private final String servicePath;

    RequestTypeEnum(String key, String desc, String servicePath) {
        this.key = key;
        this.desc = desc;
        this.servicePath = servicePath;
    }

    public static RequestTypeEnum get(String key) {
        for (RequestTypeEnum e : RequestTypeEnum.values()) {
            if (e.getKey().equals(key)) {
                return e;
            }
        }
        throw new IllegalArgumentException(String.format("%s is not a valid value for %s", key, RequestTypeEnum.class));
    }

    public static boolean isInclude(String key) {
        boolean include = false;
        for (RequestTypeEnum e : RequestTypeEnum.values()) {
            if (e.getKey().equals(key)) {
                include = true;
                break;
            }
        }
        return include;
    }

}
